package hn.cch.dao.impl;

import hn.cch.dao.PlayDao;
import hn.cch.dao.UserDao;
import hn.cch.jdbc.JdbcDao;
import hn.cch.model.Play;
import hn.cch.model.User;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by chench on 2020-5-21.
 */

@Component(value = "userDao")
public class UserDaoImpl extends JdbcDao implements UserDao {
    @Override
    public List<User> getAll() {
        StringBuffer sql = new StringBuffer();
        sql.append("select username,password from unity_user");
        List<User> list = getSimpleJdbcTemplate().query(sql.toString(), new BeanPropertyRowMapper(User.class));
        return list;


    }
}
